'use strict'

module.exports = angular.module 'lib.filters.status', []
.filter 'skuStatus', ($log)->
  $log.log "sku status init"
  return (status)->
    switch status
      when 'ACTIVE'   then return '上架'
      when 'INACTIVE' then return '下架'
      when 'DRAFT' then return '草稿'
      else return ''
.filter 'productStatus', ($log)->
  $log.log "product status init"
  return (status)->
    switch status
      when 'ACTIVE' then return '上架'
      when 'INACTIVE' then return '下架'
      when 'DRAFT' then return '草稿'
      else return ''
.filter 'productType', ($log)->
  $log.log "product type init"
  return (type)->
    switch type
      when 'SINGLE'   then return '单品'
      when 'BUNDLE'   then return '套餐'
      else return ''
.filter 'productPayMode', ($log)->
  $log.log "product pay mode init"
  return (mode)->
    switch mode
      when 'NORMAL'   then return '全款'
      when 'DEPOSIT'   then return '定金'
      else return ''
.filter 'orderStatus', ($log)->
  $log.log "order status init"
  return (status)->
    switch status
      when 'UNPAID'     then return '待支付'
      when 'PAID'       then return '待发货'
      when 'NOTIFIED'   then return '已通知发货'
      when 'COMPLETED'  then return '已确认发货'
      when 'CANCELLED'  then return '已取消'
      when 'EXPIRED'    then return '已过期'
      else return ''
